Optimal. Leaf size=277 \[ \frac{b \text{PolyLog}\left (2,1-\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{c^3 d}+\frac{i b^2 \text{PolyLog}\left (2,1-\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \text{PolyLog}\left (3,1-\frac{2}{1+i c x}\right )}{2 c^3 d}+\frac{i a b x}{c^2 d}+\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c^3 d}+\frac{2 b \log \left (\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{c^3 d}-\frac{i \log \left (\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )^2}{c^3 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}-\frac{i b^2 \log \left (c^2 x^2+1\right )}{2 c^3 d}+\frac{i b^2 x \tan ^{-1}(c x)}{c^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.513029, antiderivative size = 277, normalized size of antiderivative = 1., number of steps used = 16, number of rules used = 12, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.48, Rules used = {4866, 4852, 4916, 4846, 260, 4884, 4920, 4854, 2402, 2315, 4994, 6610} \[ \frac{b \text{PolyLog}\left (2,1-\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{c^3 d}+\frac{i b^2 \text{PolyLog}\left (2,1-\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \text{PolyLog}\left (3,1-\frac{2}{1+i c x}\right )}{2 c^3 d}+\frac{i a b x}{c^2 d}+\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c^3 d}+\frac{2 b \log \left (\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{c^3 d}-\frac{i \log \left (\frac{2}{1+i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )^2}{c^3 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}-\frac{i b^2 \log \left (c^2 x^2+1\right )}{2 c^3 d}+\frac{i b^2 x \tan ^{-1}(c x)}{c^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4866
Rule 4852
Rule 4916
Rule 4846
Rule 260
Rule 4884
Rule 4920
Rule 4854
Rule 2402
Rule 2315
Rule 4994
Rule 6610
Rubi steps
\begin{align*} \int \frac{x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{d+i c d x} \, dx &=\frac{i \int \frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{d+i c d x} \, dx}{c}-\frac{i \int x \left (a+b \tan ^{-1}(c x)\right )^2 \, dx}{c d}\\ &=-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}-\frac{\int \frac{\left (a+b \tan ^{-1}(c x)\right )^2}{d+i c d x} \, dx}{c^2}+\frac{(i b) \int \frac{x^2 \left (a+b \tan ^{-1}(c x)\right )}{1+c^2 x^2} \, dx}{d}+\frac{\int \left (a+b \tan ^{-1}(c x)\right )^2 \, dx}{c^2 d}\\ &=\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2 \log \left (\frac{2}{1+i c x}\right )}{c^3 d}+\frac{(i b) \int \left (a+b \tan ^{-1}(c x)\right ) \, dx}{c^2 d}-\frac{(i b) \int \frac{a+b \tan ^{-1}(c x)}{1+c^2 x^2} \, dx}{c^2 d}+\frac{(2 i b) \int \frac{\left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{c^2 d}-\frac{(2 b) \int \frac{x \left (a+b \tan ^{-1}(c x)\right )}{1+c^2 x^2} \, dx}{c d}\\ &=\frac{i a b x}{c^2 d}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c^3 d}+\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2 \log \left (\frac{2}{1+i c x}\right )}{c^3 d}+\frac{b \left (a+b \tan ^{-1}(c x)\right ) \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{c^3 d}+\frac{(2 b) \int \frac{a+b \tan ^{-1}(c x)}{i-c x} \, dx}{c^2 d}+\frac{\left (i b^2\right ) \int \tan ^{-1}(c x) \, dx}{c^2 d}-\frac{b^2 \int \frac{\text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{c^2 d}\\ &=\frac{i a b x}{c^2 d}+\frac{i b^2 x \tan ^{-1}(c x)}{c^2 d}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c^3 d}+\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}+\frac{2 b \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2 \log \left (\frac{2}{1+i c x}\right )}{c^3 d}+\frac{b \left (a+b \tan ^{-1}(c x)\right ) \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \text{Li}_3\left (1-\frac{2}{1+i c x}\right )}{2 c^3 d}-\frac{\left (2 b^2\right ) \int \frac{\log \left (\frac{2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{c^2 d}-\frac{\left (i b^2\right ) \int \frac{x}{1+c^2 x^2} \, dx}{c d}\\ &=\frac{i a b x}{c^2 d}+\frac{i b^2 x \tan ^{-1}(c x)}{c^2 d}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c^3 d}+\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}+\frac{2 b \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2 \log \left (\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \log \left (1+c^2 x^2\right )}{2 c^3 d}+\frac{b \left (a+b \tan ^{-1}(c x)\right ) \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \text{Li}_3\left (1-\frac{2}{1+i c x}\right )}{2 c^3 d}+\frac{\left (2 i b^2\right ) \operatorname{Subst}\left (\int \frac{\log (2 x)}{1-2 x} \, dx,x,\frac{1}{1+i c x}\right )}{c^3 d}\\ &=\frac{i a b x}{c^2 d}+\frac{i b^2 x \tan ^{-1}(c x)}{c^2 d}+\frac{i \left (a+b \tan ^{-1}(c x)\right )^2}{2 c^3 d}+\frac{x \left (a+b \tan ^{-1}(c x)\right )^2}{c^2 d}-\frac{i x^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c d}+\frac{2 b \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i \left (a+b \tan ^{-1}(c x)\right )^2 \log \left (\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \log \left (1+c^2 x^2\right )}{2 c^3 d}+\frac{i b^2 \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{c^3 d}+\frac{b \left (a+b \tan ^{-1}(c x)\right ) \text{Li}_2\left (1-\frac{2}{1+i c x}\right )}{c^3 d}-\frac{i b^2 \text{Li}_3\left (1-\frac{2}{1+i c x}\right )}{2 c^3 d}\\ \end{align*}
Mathematica [A] time = 0.554076, size = 330, normalized size = 1.19 \[ -\frac{i \left (6 b \text{PolyLog}\left (2,-e^{2 i \tan ^{-1}(c x)}\right ) \left (-i a-i b \tan ^{-1}(c x)+b\right )+3 b^2 \text{PolyLog}\left (3,-e^{2 i \tan ^{-1}(c x)}\right )+3 a^2 c^2 x^2-3 a^2 \log \left (c^2 x^2+1\right )+6 i a^2 c x-6 i a^2 \tan ^{-1}(c x)-6 i a b \log \left (c^2 x^2+1\right )+6 a b c^2 x^2 \tan ^{-1}(c x)-6 a b c x-12 i a b \tan ^{-1}(c x)^2+6 a b \tan ^{-1}(c x)+12 i a b c x \tan ^{-1}(c x)+12 a b \tan ^{-1}(c x) \log \left (1+e^{2 i \tan ^{-1}(c x)}\right )+3 b^2 \log \left (c^2 x^2+1\right )+3 b^2 c^2 x^2 \tan ^{-1}(c x)^2-4 i b^2 \tan ^{-1}(c x)^3+9 b^2 \tan ^{-1}(c x)^2+6 i b^2 c x \tan ^{-1}(c x)^2-6 b^2 c x \tan ^{-1}(c x)+6 b^2 \tan ^{-1}(c x)^2 \log \left (1+e^{2 i \tan ^{-1}(c x)}\right )+12 i b^2 \tan ^{-1}(c x) \log \left (1+e^{2 i \tan ^{-1}(c x)}\right )\right )}{6 c^3 d} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 1.643, size = 1212, normalized size = 4.4 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{i \, b^{2} x^{2} \log \left (-\frac{c x + i}{c x - i}\right )^{2} + 4 \, a b x^{2} \log \left (-\frac{c x + i}{c x - i}\right ) - 4 i \, a^{2} x^{2}}{4 \, c d x - 4 i \, d}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \arctan \left (c x\right ) + a\right )}^{2} x^{2}}{i \, c d x + d}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]